<template>
 <div>
  <el-dialog
  title="题目审核"
  :visible="visible"
  width="20%"
  @close="AudithandleClose">
  <el-form>
    <el-form-item>
      <el-radio v-model="AuditForm.chkState" :label="1">通过</el-radio>
      <el-radio v-model="AuditForm.chkState" :label="2">拒绝</el-radio>
    </el-form-item>
    <el-form-item >
    <el-input placeholder="请输入审核意见" type="textarea" v-model="AuditForm.chkRemarks"></el-input>
  </el-form-item>
  </el-form>
  <span slot="footer" class="dialog-footer">
    <el-button @click="AudithandleClose">取 消</el-button>
    <el-button type="primary" @click="subimtEditAudit">确 定</el-button>
  </span>
</el-dialog>
 </div>
</template>
<script>
import { choiceCheck } from '@/api/hmmm/questions'
export default {
  name: 'QuestionAudit',
  props: {
    visible: {
      type: Boolean,
      default: false
    }
  },
  data () {
    return {
      AuditForm: {
        id: '',
        chkState: 1,
        chkRemarks: ''
      }
    }
  },
  created () {
  },
  computed: {
  },
  methods: {
    // 点击确定审核
    async subimtEditAudit (_, id) {
      if (this.AuditForm.chkRemarks.trim() === '') {
        this.$message({
          message: '请输入审核意见',
          type: 'warning'
        })
        return
      }
      await choiceCheck(this.AuditForm)
      this.AudithandleClose()
      this.$emit('customEvent')
    },
    editAudit (id) {
      this.AuditForm.id = id
    },
    // 关闭审核对话框的回调函数
    AudithandleClose () {
      this.AuditForm = this.$options.data().AuditForm
      this.$emit('update:visible', false)
    }
  }
}
</script>
<style lang='scss'  scoped>

</style>
